Display "Waiting to send mail..."
Answer 1
;1=Use TLS on SMTP Connect
smtp.SetSSL(1)
;Connecting to Server
Display "Connecting server..."
$Status = smtp.Connect($ServerName,$Port)
if $Status <> 1
Display "Connection Failed.."
log "Connection Failed " $error
hangup
Goto Main
endif
;Login to Server
Display "Login to server..."
$Status = smtp.Login($Username,$Password,$Method)
if $Status <> 1
Display "Login Failed.."
log "Login Failed " $error
hangup
Goto Main
endif
; Sending Mail
Display "Sending Mail..."
$StatusSendText = smtp.SendTextMail($From,$To,$Subject,$Body)
if $StatusSendText <> 1
Display "Sending Failed.."
log "Sending Failed " $error
endif
;Closing Connection
Display "Closing connection..."
smtp.close()
hangup
Goto MAIN
* User has hung up
ONHANGUP: